//
//  QMAShareModel.h
//  QQMiniAppSDK
//
//  Created by hankzhu on 2020/1/14.
//

#import <Foundation/Foundation.h>
#import "QMAUIDelegate.h"

NS_ASSUME_NONNULL_BEGIN

OBJC_EXTERN NSInteger const QMAShareUserCancelErrorCode;

// 分享配置
@interface QMAShareConfig : NSObject

@property(nonatomic, assign, readonly) BOOL isFromShareButton;           // 分享ARK模版数据
@property(nonatomic, assign, readonly) MAShareTarget shareTarget;
@property(nonatomic, strong, readonly) NSString *shareType;              // 分享类型，比如picture图片分享
@property(nonatomic, assign, readonly) BOOL isFromDetailPage;            // 是否从详情页点击过来的分享
@property(nonatomic, assign, readonly) NSInteger shareWithTicket;        // 是否需要带shareTicket

// 通过jsplugin params构造
- (instancetype)initWithParams:(NSDictionary *)params;

@end


// 分享数据
@interface QMAShareModel : NSObject

@property(nonatomic, strong, readonly) NSString *title;                  // 分享标题
@property(nonatomic, strong, readonly) NSString *imageUrl;               // 分享图片，可以是http(s)或者本地图片
@property(nonatomic, strong, readonly) NSString *path;                   // 分享页面路径
@property(nonatomic, strong, readonly) NSString *query;                  // 分享路径参数
@property(nonatomic, strong, readonly) NSString *nickName;               // 昵称
@property(nonatomic, strong, readonly) NSString *vidUrl;                 // 视频分享
@property(nonatomic, strong, readonly) NSString *generalWebpageUrl;      // 如果对应设备不支持小程序，兜底webpage
@property(nonatomic, strong, readonly) NSString *openId;                 // openid分享，用于小游戏开放数据域
@property(nonatomic, strong, readonly) NSString *shareTemplateId;        // 分享ARK模版ID
@property(nonatomic, strong, readonly) NSDictionary *shareTemplateData;  // 分享ARK模版数据
@property(nonatomic, strong, readonly) QMAShareConfig *config;           // 分享配置
@property(nonatomic, strong) NSString *eventName; // 哪个api调用的 for数据上报

// 给宿主格式为 {"jump_url":"https://m.q.qq.com/minisdk/s/30d1b3d0f2b28741c477f47b8910f0e3"}
@property(nonatomic, strong) NSString *dataToShare;                      // 分享数据

// 通过jsplugin params构造
- (instancetype)initWithParams:(NSDictionary *)params;

// 从详情页分享的构造方法
- (instancetype)initWithTitle:(NSString *)title imageURL:(NSString *)imageURL isFromDetailPage:(BOOL)isFromDetailPage;

@end



NS_ASSUME_NONNULL_END
